package com.gjy.test.other;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2022-11-14 11:21:28
 */
public class T1 {

    public static void main(String[] args) throws JsonProcessingException {
        LocalDateTime gmt = LocalDateTime.ofInstant(Instant.ofEpochSecond(1674971217L), ZoneId.of("GMT+8"));
        System.out.println(gmt);

        ObjectMapper om = new ObjectMapper();
        Object r = null;
        String json = om.writeValueAsString(r);
        System.out.println("json = " + json);
        System.out.println("json = " + json.length());
    }
}
